<template>
    <div>
        <h2>当前和为：{{count}}</h2>
        <button @click="count++">点击+1</button>
    </div>
</template>
<script>
import { ref, defineComponent, reactive, computed, watch, watchEffect } from 'vue'
export default defineComponent({
    name: 'Setup',
    components: {  },
    setup () {
        // watchEffect
        let count = ref(0)
        watchEffect(() => {
            // 使用谁就监听谁
            const copyCount = count.value
            console.log(copyCount)
            console.log('进入了watchEffect的监听')
        })
        return {
            count
        }
    }
})
</script>
<style lang="">
    
</style>